package com.hc.service.impl;

import com.hc.bean.User;
import com.hc.dao.UserDao;
import com.hc.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    @Override
    public Boolean addUser(User user) {
        if(userDao.addUser(user)>0)
            return true;
        return false;
    }

    @Override
    public Boolean isExitUserName(String userName) {
        if(userDao.isExitUserName(userName).size()>0)
            return true;
        return false;
    }

    @Override
    public User isPassword(User user) {
        return userDao.identityUser(user);
    }

    @Override
    public Boolean updateUser(User user) {
        return null;
    }

    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }
}
